const fs = require('fs');
const ps = require('path');
const file = ps.join(__dirname, '../project/extensions/mlagents/static/assets/Runtime/Grpc/CommunicatorObjects', 'pb.d.ts');
const original = fs.readFileSync(file, { encoding: 'utf8' });
fs.writeFileSync(file, `
export namespace proto {
    ${original}
}
export default proto;
`);

const file2 = ps.join(__dirname, '../project/extensions/mlagents/static/assets/ONNX/Generated/', 'pb.d.ts');
const original2 = fs.readFileSync(file2, { encoding: 'utf8' });
fs.writeFileSync(file2, `
export namespace proto {
    ${original2}
}
export default proto;
`);